# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=whois
pkgver=5.3.2
pkgrel=2
pkgdesc='Intelligent WHOIS client'
url='https://github.com/rfc1036/whois'
license=('GPL')
arch=('x86_64')
depends=('libidn2')
makedepends=('perl')
source=("http://ftp.debian.org/debian/pool/main/w/whois/${pkgname}_${pkgver}.tar.xz")
sha256sums=('79714ba89172bca08a2443f59885daa4af0c5f8d6a49bc9e7f2a83559a286354')

backup=('etc/whois.conf')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	make \
		CONFIG_FILE=/etc/whois.conf \
		CFLAGS="$CFLAGS $CPPFLAGS" \
		HAVE_ICONV=1
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	make prefix=/usr BASEDIR="${pkgdir}" install-whois
	install -D -m644 whois.conf "${pkgdir}/etc/whois.conf"
}
